package com.hippo.javacore.javaiostream.iostream;

import java.io.BufferedWriter;
import java.io.FileWriter;

/**
 * @ClassName BufferWriter
 * @Description TODO 字符缓冲输出流
 * @Author tangxl
 * @create 2023-04-06 19:09
 **/
public class BufferedWriterOpt {
    public static void main(String[] args) {
        // 字符缓冲输出流
        try(
                // 创建字符缓冲输出流对象
                BufferedWriter bw = new BufferedWriter(new FileWriter("study-commons/java-file-iostream/src/main/resources/file/a.txt",true));
        ) {
            // 写数据
            bw.write("hello");
            bw.newLine();
            bw.write("world");
            bw.newLine();
            bw.write("java");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
